package start.doubudouyin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import start.doubudouyin.entity.Admininfo;
import start.doubudouyin.service.AdmininfoService;
import start.doubudouyin.mapper.AdmininfoMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 38798
* @description 针对表【admininfo(管理员信息表)】的数据库操作Service实现
* @createDate 2025-05-30 10:57:42
*/
@Service
public class AdmininfoServiceImpl extends ServiceImpl<AdmininfoMapper, Admininfo>
    implements AdmininfoService{
    @Resource
    private AdmininfoMapper admininfoMapper;

    public String isPhoneExist(String phone) {
        if(admininfoMapper.isPhoneExist(phone)!=null){
            return phone;
        }else{
            return null;
        }
    }
    public String isIdcardExist(String idcard){
        if(admininfoMapper.isIdcardExist(idcard)!=null){
            return idcard;
        }else{
            return null;
        }
    }
    public Integer AdminLogin(String phone,String password){
        return admininfoMapper.AdminLogin(phone,password);
    }
    public Integer isAdminOnline(Integer adminId){
        return admininfoMapper.isAdminOnline(adminId);
    }
    public Integer AdminRegisterPass(Admininfo admininfo) {
        return admininfoMapper.AdminRegisterPass(admininfo);
    }

    public Integer updateonlineStatus(Integer onlineStatus,Integer adminId){
        return admininfoMapper.updateonlineStatus(onlineStatus,adminId);
    }

    @Override
    public Admininfo getById(Admininfo admininfo) {
        return admininfoMapper.getById(admininfo);
    }
    public Integer UpdatePassword(String phone,String idcard,String password) {
        return admininfoMapper.UpdatePassword(phone,idcard,password);
    }
    public String VerifyAdmin(String phone,String idcard){
        return admininfoMapper.VerifyAdmin(phone,idcard);
    }
    public List<Admininfo> findAll(){
        return admininfoMapper.findAll();
    }
    public Integer deletebyId(Integer adminId){
        return admininfoMapper.deletebyId(adminId);
    }
    public Integer updatePasswordById (String password,String adminId){
        return admininfoMapper.updatePasswordById (password,adminId);
    }
    public String VerifyPassword(String adminId,String password){
        return admininfoMapper.VerifyPassword(adminId,password);
    }
    public String VerifyId(String adminId,String idcard){
        return admininfoMapper.VerifyId(adminId,idcard);
    }
}




